#include "beep_drv.h"

void Beep_Init(void)
{
	PWMx_InitDefine	PWMx_InitStructure;
    
    PWMx_InitStructure.PWM_Mode           = CCMRn_PWM_MODE1;	
    PWMx_InitStructure.PWM_Duty           = 0;
    PWMx_InitStructure.PWM_EnoSelect      = ENO2P;
 	PWMx_InitStructure.PWM_Period         = DEF_PWM_PERIOD;
	PWMx_InitStructure.PWM_DeadTime       = 0;				
	PWMx_InitStructure.PWM_MainOutEnable  = ENABLE;		
	PWMx_InitStructure.PWM_CEN_Enable     = ENABLE;	

    // PWMA_Prescaler(PRE_DIVISION);
	PWM_Configuration(PWM2, &PWMx_InitStructure);    
    PWM_Configuration(PWMA, &PWMx_InitStructure); 
    NVIC_PWM_Init(PWMA,DISABLE,Priority_0);
    PWM2_USE_P22P23();
}
